package com.service.api;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.handler.codec.http.HttpContentCompressor;
import org.jboss.netty.handler.codec.http.HttpRequestDecoder;
import org.jboss.netty.handler.codec.http.HttpResponseEncoder;

public class HttpServerPipelineFactory implements ChannelPipelineFactory {
	public ChannelPipeline getPipeline() throws Exception {
		ChannelPipeline localChannelPipeline = Channels.pipeline();
		localChannelPipeline.addLast("decoder", new HttpRequestDecoder());
		localChannelPipeline.addLast("encoder", new HttpResponseEncoder());
		localChannelPipeline.addLast("deflater", new HttpContentCompressor());
		localChannelPipeline.addLast("handler", new HttpRequestHandler());
		return localChannelPipeline;
	}
}